<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <script type="text/javascript" src="${pageContext.request.contextPath}/resource/js/jquery1.4.js"></script>
	<title>Hive-Top 注册</title>
  </head>
  
  <body>
  
  	<jsp:include page="../inc/head_nav.jsp" />
<div class="hr tp-div-nexthr" style="margin-top: 0;margin-bottom: 0;padding: 0;"></div>
	<div class="container pb-15">
	<!-- Example row of columns -->
	<div class="row">
		<div class="span16">
			<div class="label-public-title t-30">
		    <ul class="clearfix">
				<li class="pull-left r-20 border-all"><a href="${pageContext.request.contextPath}/user/userLogin.jsp" title="登录">登录</a></li>
				<li class="pull-left selected border-all"><a href="javascript:;" title="注册" style="_padding: 0;">注册</a></li>
				</ul>
			</div>
			<div class="label-div t-15 border-all" style="padding: 0;">
				<div class="label-main">
					<div class="clearfix label-public pt-25">
						<div class="pull-left public-login span10" id="register-third" style="display: block;">
							<div class="fc333 l-30"><h3><strong>H</strong><strong>i</strong><strong>v</strong><strong>e  </strong><strong> T</strong><strong>o</strong><strong>p</strong></h3> 我们将引领你进行账号注册，30秒即可完成注册</div>
							<div class="clearfix t-25 third-party l-30">
								<img alt="Hive-Top" src="${pageContext.request.contextPath}/resource/images/login_logo_annc.jpg" style="width:450px; margin-right:30px; margin-bottom: 15px;">
							</div>
							<p class="l-30 t-30 fc999"><span id="Countdown">页面将在 (3) 秒之后跳转，若页面没有跳转，请点击</span><a href="javascript:;" title="注册" class="l-5 email-register-button">注册</a></p>
						</div>
                        
                        <div class="clearfix" id="register-mail" style="display: none;">
							<form enctype="multipart/form-data" id="subform" action="${pageContext.request.contextPath}/UserSer?tag=reg" method="post">							<div class="pull-left public-login span10">
								<div class="pl-25 fc333">欢迎加入我们  Hive-Top 大家庭</div>
								<div class="clearfix pl-25 pt-25">
									<div class="title pull-left fc999">用户名</div>
									<div class="pull-left l-20" style="_margin-left: 0;_width: 100px;"><input class="span4" name="userName" id="UcenterMember_account" type="text" maxlength="32" value=""/></div>
									<span class="pull-left l-20 fc999 info account_msg" id="account_msg">${errMess!=null?errMess:'设置您的个性化用户名' }</span>
								</div>
								<div class="clearfix pl-25 pt-25">
									<div class="title pull-left fc999">邮箱</div>
									<div class="pull-left l-20" style="_margin-left: 0;_width: 100px;"><input class="span4" name="userEmail" id="UcenterMember_email" type="text" maxlength="128" value="${user.userEmail!=null?user.userEmail:null}"/></div>
									<span class="pull-left l-20 fc999 info email_msg" id="email_msg">绑定您的邮箱</span>
								</div>
								<div class="clearfix pl-25 pt-25">
									<div class="title pull-left fc999">密码</div>
									<div class="pull-left l-20" style="_margin-left: 0;_width: 100px;"><input type="password" id="UcenterMember_password1" name="userPwd" class="span4" value="" /></div>
									<span class="pull-left l-20 fc999 info password_msg" id="pwd_msg">密码最小值为6位（字母区分大小写）</span>
								</div>
								<div class="clearfix pl-25 pt-25">
									<div class="title pull-left fc999">确认密码</div>
									<div class="pull-left l-20" style="_margin-left: 0;_width: 100px;"><input type="password" id="UcenterMember_password2" name="userRepwd" class="span4" value=""/></div>
									<span class="pull-left l-20 fc999 info password_msg" id="repwd_msg">请再次输入密码</span>
								</div>
								<div class="clearfix pl-25 pt-25">
									<div class="title pull-left">&nbsp;</div>
									<div class="pull-left l-20 t-8" style="_width: auto;_margin-left: 15px;"><input type="checkbox" checked="checked" style="_width: 20px;_margin: 0;"/></div>
									<span class="pull-left l-5 info fc999" style="_width: auto;_margin: 0;">我已阅读并接受<a href="${pageContext.request.contextPath}/user/agreeMent.jsp" title="Hive-Top协议" target="_blank">《Hive-Top》注册条款</a></span>
								</div>
								<div class="clearfix pl-25 pt-25 pb-30">
									<div class="title pull-left l-20" style="_margin-left: 10px;">&nbsp;</div>
									<a href="javascript:void(0);" name="submit" title="注册" class="pull-left login-register-btn" onclick="submit_form(this)">注&nbsp;册</a> <!-- 可用的onclick值: document.getElementById('subform').submit();return false -->
									<span class="pull-left l-20 info fc999" style="_width: auto;_margin: 0 0 0 10px;">不想注册了？<a class="l-5 sina-register-button" href="javascript:void(0)" title="返回">返回</a></span>
								</div>
							</div>
							<div class="pull-left t-50 l-20">
								<div class="label-div border-all" style="padding: 10px;width: 150px;"><img id="faceimg" class="lazyloadimg show_fave" src="${pageContext.request.contextPath}/resource/images/user_180.gif" style="width: 150px;height: 150px; display: block;" /></div>
								<div class="center t-10"><input id="file" type='file' name="file" onChange="ajaxFileUpload()" /><input id="new_face" type='hidden' name="new_face" value="" /></div>
							</div>
							</form>						
                          </div>
						 
					</div>
				</div>
			</div>
		</div>
	</div>
</div>


<!-- /container -->
 <div class="container">
 
 	<div class="hr"></div>
    
    </div>
  
<!-- /container -->


<jsp:include page="../inc/footer_nav.jsp"></jsp:include>
     
  <script type="text/javascript">
$('input').keydown(function(event){  
	if(event.keyCode == 13)submit_form('.login-register-btn');
}); 

var submit_form = function(obj) {
	 adminLogin();
};


//网站后台登录
adminLogin = function(){
	var reg1 = /\w{6}/;     		//不能少于6位
	var reg2 = /^[A-Za-z]/;		//开头必须为字母
	var reg3 = /[0-9A-Za-z]/;	//只允许包含数字、大小写字母
	//用户名验证
	if($('#UcenterMember_account').attr("value") == ''){
		$("#account_msg").html('请输入您的用户名').css('color','red');
		$("#UcenterMember_account").focus();
		setTimeout(function(){$("#account_msg").html('设置您的个性化用户名').css('color','#999');},3000);
		return false;
	} else if(!reg1.test($('#UcenterMember_account').attr("value"))){
		$("#account_msg").html('用户名不能少于6位').css('color','red');
		$("#UcenterMember_account").focus();
		setTimeout(function(){$("#account_msg").html('设置您的个性化用户名').css('color','#999');},3000);
		return false;
	} else if(!reg2.test($('#UcenterMember_account').attr("value"))){
		$("#account_msg").html('开头只能为小写、大写字母').css('color','red');
		$("#UcenterMember_account").focus();
		setTimeout(function(){$("#account_msg").html('设置您的个性化用户名').css('color','#999');},3000);
		return false;
	} else if(!reg3.test($('#UcenterMember_account').attr("value"))){
		$("#account_msg").html('只支持大、小写字母和数字作为用户名').css('color','red');
		$("#UcenterMember_account").focus();
		setTimeout(function(){$("#account_msg").html('设置您的个性化用户名').css('color','#999');},3000);
		return false;
	} 
	//密码验证
	if($('#UcenterMember_password1').attr("value") == ''){
		$("#pwd_msg").html('密码不能为空').css('color','red');
		$("#UcenterMember_password1").focus();
		setTimeout(function(){$("#pwd_msg").html('密码最小值为6位（字母区分大小写）').css('color','#999');},3000);
		return false;
	} else if(!reg1.test($('#UcenterMember_password1').attr("value"))){
		$("#pwd_msg").html('密码不能少于6位').css('color','red');
		$("#UcenterMember_password1").focus();
		setTimeout(function(){$("#pwd_msg").html('密码最小值为6位（字母区分大小写）').css('color','#999');},3000);
		return false;
	}
	//再次输入密码验证
	var pwd = $('#UcenterMember_password1').val();
	if(pwd != $('#UcenterMember_password2').attr("value")){
		$("#repwd_msg").html('两次输入的密码不匹配').css('color','red');
		$("#UcenterMember_password2").focus();
		setTimeout(function(){$("#repwd_msg").html('请再次输入密码').css('color','#999');},3000);
		return false;
	}
	
	document.getElementById("subform").submit();
	return true;
};
</script>
 
<script type="text/javascript">backToTop('body');</script>
 

<script type="text/javascript">
$(document).ready(function(){
	$(".email-register-button").click(function(){
		$("#register-mail").fadeIn();
		$("#register-third").hide(); 
		$('#UcenterMember_account').focus();
	});
	$(".sina-register-button").click(function(){
		$("#register-mail").hide();
		$("#register-third").fadeIn(); 
	});
});

$('input').keydown(function(event){  
	if(event.keyCode == 13)submit_form('.login-register-btn');
});
 

</script>
<!-- 页面倒计时跳转效果 -->
<script type="text/javascript">

var t=2;
var intervalid; 
intervalid = setInterval("refer()", 1000); 
function refer(){ 
 if(t==0){ 
		$("#register-mail").fadeIn();
		$("#register-third").hide();
		if($('#UcenterMember_account').val() == '') {
			$('#UcenterMember_account').focus();
		}
		clearInterval(intervalid); 
 } 
 document.getElementById('Countdown').innerHTML="页面将在 ("+t+") 秒之后跳转，若页面没有跳转，请点击";
 t--;
} 
</script>
 
  </body>
</html>
